package com.basic;

import com.frame.struts.BaseBean;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.frame.struts.ActionContext;
import com.utils.*;

/**
 * <p>Title: </p>
 * <p>Description: </p>
 * <p>Copyright: Copyright (c) 2006</p>
 * <p>Company: </p>
 * @author not attributable
 * @version 1.0
 */

public class DecisionForm extends BaseBean {
    public DecisionForm() {
    }
	DecisionEntity den = new DecisionEntity();
	public String addDecision(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		den.setQyid(qyid);
		try{
		if(factory.addDecision(den)){
			    response.sendRedirect("/basic/modifyMangerScheme.jsp");
				return "success";
		}
		response.sendRedirect("/basic/failed.jsp");
		}
		catch (Exception e) {

		}

		return "failed";

	}
	public String modifyDecision(){
		HttpServletRequest request = ActionContext.getActionContext().
			getRequest();
		HttpServletResponse response = ActionContext.getActionContext().
			getResponse();
		BasicFactory factory = new BasicFactory();
		String qyid = (String) request.getSession().getAttribute("session_qyid");
		den.setQyid(qyid);
        try{
		if(factory.addDecision(den)){
			    response.sendRedirect("/basic/modifyMangerScheme.jsp");
				return "success";
		}
		response.sendRedirect("/basic/failed.jsp");
		}
		catch (Exception e) {

		}

			return "failed";

	}

	public void setGlzjyjcjz(String glzjyjcjz){
		den.setGlzjyjcjz(glzjyjcjz);
		//System.out.println("ksajfd:"+glzjyjcjz);
	}
	public String getGlzjyjcjz(){
		return den.getGlzjyjcjz();
	}
	public void setQyid(String qyid){
		den.setQyid(qyid);
	}
	public String getQyid(){
		return den.getQyid();
	}

}